<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AWTK-JAVA: awtk.ColorTile类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">AWTK-JAVA
   </div>
   <div id="projectbrief">AWTK JAVA API</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>awtk</b></li><li class="navelem"><a class="el" href="classawtk_1_1_color_tile.html">ColorTile</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pub-static-methods">静态 Public 成员函数</a> &#124;
<a href="#pub-attribs">Public 属性</a> &#124;
<a href="classawtk_1_1_color_tile-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">awtk.ColorTile类 参考</div>  </div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
类 awtk.ColorTile 继承关系图:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classawtk_1_1_color_tile.png" usemap="#awtk.ColorTile_map" alt=""/>
  <map id="awtk.ColorTile_map" name="awtk.ColorTile_map">
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a24e82ea58332906a85fd8efb4f792e89"><td class="memItemLeft" align="right" valign="top"><a id="a24e82ea58332906a85fd8efb4f792e89"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>ColorTile</b> (long nativeObj)</td></tr>
<tr class="separator:a24e82ea58332906a85fd8efb4f792e89"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a74167f425bed87f67a496fe503f425c0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="enumawtk_1_1_ret.html">Ret</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_color_tile.html#a74167f425bed87f67a496fe503f425c0">setBgColor</a> (String color)</td></tr>
<tr class="separator:a74167f425bed87f67a496fe503f425c0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a417ef526083dfc9842fc34ff6071fdbc"><td class="memItemLeft" align="right" valign="top">String&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_color_tile.html#a417ef526083dfc9842fc34ff6071fdbc">getBgColor</a> ()</td></tr>
<tr class="separator:a417ef526083dfc9842fc34ff6071fdbc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7d92cc2d6aa29635d4bfa6fc04238df2"><td class="memItemLeft" align="right" valign="top">String&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_color_tile.html#a7d92cc2d6aa29635d4bfa6fc04238df2">getBorderColor</a> ()</td></tr>
<tr class="separator:a7d92cc2d6aa29635d4bfa6fc04238df2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
静态 Public 成员函数</h2></td></tr>
<tr class="memitem:a98a140f85a94ed4cd74817ada2e1b8ce"><td class="memItemLeft" align="right" valign="top"><a id="a98a140f85a94ed4cd74817ada2e1b8ce"></a>
static <a class="el" href="classawtk_1_1_color_tile.html">ColorTile</a>&#160;</td><td class="memItemRight" valign="bottom"><b>cast</b> (long nativeObj)</td></tr>
<tr class="separator:a98a140f85a94ed4cd74817ada2e1b8ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a843271ae03b7aeb7f71df9f965ce81ae"><td class="memItemLeft" align="right" valign="top">static Widget&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_color_tile.html#a843271ae03b7aeb7f71df9f965ce81ae">create</a> (Widget parent, int x, int y, int w, int h)</td></tr>
<tr class="separator:a843271ae03b7aeb7f71df9f965ce81ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa7aee3770d6b01d1ba54d19e4ea0d596"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classawtk_1_1_color_tile.html">ColorTile</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_color_tile.html#aa7aee3770d6b01d1ba54d19e4ea0d596">cast</a> (Widget widget)</td></tr>
<tr class="separator:aa7aee3770d6b01d1ba54d19e4ea0d596"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public 属性</h2></td></tr>
<tr class="memitem:a0b58ed5c0eb66e961aabaf639d2c3254"><td class="memItemLeft" align="right" valign="top"><a id="a0b58ed5c0eb66e961aabaf639d2c3254"></a>
long&#160;</td><td class="memItemRight" valign="bottom"><b>nativeObj</b></td></tr>
<tr class="separator:a0b58ed5c0eb66e961aabaf639d2c3254"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>色块控件。</p>
<p>用来显示一个颜色块，它通过属性而不是主题来设置颜色，方便在运行时动态改变颜色。</p>
<p>可以使用value属性访问背景颜色的颜色值。</p>
<p>color_tile_t是widget的子类控件，widget_t的函数均适用于color_tile_t控件。</p>
<p>在xml中使用"color_tile"标签创建色块控件。如：</p>
<div class="fragment"><div class="line">&lt;<span class="keywordtype">color_tile</span> <span class="keyword">x</span>=<span class="stringliteral">&quot;c&quot;</span> <span class="keyword">y</span>=<span class="stringliteral">&quot;m&quot;</span> <span class="keyword">w</span>=<span class="stringliteral">&quot;80&quot;</span> <span class="keyword">h</span>=<span class="stringliteral">&quot;30&quot;</span> <span class="keyword">bg_color</span>=<span class="stringliteral">&quot;green&quot;</span> /&gt;</div></div><!-- fragment --><p>更多用法请参考： <a href="https://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/ui/color_picker_rgb.xml">color_tile</a></p>
<p>在c代码中使用函数color_tile_create创建色块控件。如：</p>
<p>创建之后，用color_tile_set_bg_color设置背景颜色。 </p>
</div><h2 class="groupheader">成员函数说明</h2>
<a id="aa7aee3770d6b01d1ba54d19e4ea0d596"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa7aee3770d6b01d1ba54d19e4ea0d596">&#9670;&nbsp;</a></span>cast()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classawtk_1_1_color_tile.html">ColorTile</a> awtk.ColorTile.cast </td>
          <td>(</td>
          <td class="paramtype">Widget&#160;</td>
          <td class="paramname"><em>widget</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>转换为color_tile对象(供脚本语言使用)。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">widget</td><td>color_tile对象。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>color_tile对象。 </dd></dl>

</div>
</div>
<a id="a843271ae03b7aeb7f71df9f965ce81ae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a843271ae03b7aeb7f71df9f965ce81ae">&#9670;&nbsp;</a></span>create()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Widget awtk.ColorTile.create </td>
          <td>(</td>
          <td class="paramtype">Widget&#160;</td>
          <td class="paramname"><em>parent</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>w</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>h</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>创建color_tile对象</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">parent</td><td>父控件 </td></tr>
    <tr><td class="paramname">x</td><td>x坐标 </td></tr>
    <tr><td class="paramname">y</td><td>y坐标 </td></tr>
    <tr><td class="paramname">w</td><td>宽度 </td></tr>
    <tr><td class="paramname">h</td><td>高度</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>对象。 </dd></dl>

</div>
</div>
<a id="a417ef526083dfc9842fc34ff6071fdbc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a417ef526083dfc9842fc34ff6071fdbc">&#9670;&nbsp;</a></span>getBgColor()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">String awtk.ColorTile.getBgColor </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>背景颜色。 </p>

</div>
</div>
<a id="a7d92cc2d6aa29635d4bfa6fc04238df2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7d92cc2d6aa29635d4bfa6fc04238df2">&#9670;&nbsp;</a></span>getBorderColor()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">String awtk.ColorTile.getBorderColor </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>边框颜色。 </p>

</div>
</div>
<a id="a74167f425bed87f67a496fe503f425c0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a74167f425bed87f67a496fe503f425c0">&#9670;&nbsp;</a></span>setBgColor()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="enumawtk_1_1_ret.html">Ret</a> awtk.ColorTile.setBgColor </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>color</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>设置背景颜色。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">color</td><td>背景颜色。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>output/ColorTile.java</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
